﻿@model Inmeta.VSGallery.Web.Models.ReleasesViewModel
@{
    ViewBag.Title = "Inmeta Visual Studio Extension Gallery";
}
<head>
    <title>@ViewBag.Title</title>
    <script src='~/Content/jquery.js' type="text/javascript"></script>
    <script src='~/Content/jquery.MetaData.js' type="text/javascript" language="javascript"></script>
    <script src='~/Content/jquery.rating.js' type="text/javascript" language="javascript"></script>
    <link href='~/Content/jquery.rating.css' type="text/css" rel="stylesheet" />
</head>
<div>
    <h1>Inmeta Visual Studio Extension Gallery</h1>
</div>

<div class="SearchFrame">

@using (Html.BeginForm(MVC.Home.ActionNames.Search, MVC.Home.Name))
{
    <table>
        <tbody>
            <tr>
                <td style="width:480px">@Html.TextBoxFor(m => m.SearchText, new { @class = "SearchBox" })</td>
                <td><input id="search" type="submit" class="SearchIcon" value="" /></td>
                <td style="width:90%"></td>
                <td><img src="~/Content/upload.png" width="30px"/></td>
                <td>@Html.ActionLink("Upload", MVC.Upload.ActionNames.Index, MVC.Upload.Name, null, new {@style="font-size: large"})</td>
                <td style="width:10%"></td>
            </tr>
        </tbody>
    </table>
}

</div>

<table>
    @foreach (var r in Model.Releases)
    {
        <tr>
            <td class="itemImage">
                <div>
                    <img class="thumbnail" src="~/api/icon?vsixid=@r.VsixId" />
                </div>
            </td>

            <td class="itemBody">
                <div class="itemTitle">
                    @Html.ActionLink(@r.Title, MVC.Extension.Index(r.VsixId))
                </div>

                <div>
                    @r.Author
               </div>

                <div>
                    @r.Description
                </div>
            </td>
            <td class="itemSummary">
                <div class="itemSummaryItem">
                    @Html.DisplayFor(model => r.StarRating) (@r.NrRatings)
                </div>
                <div class="itemSummaryItem">
                    Updated @r.ModifiedDate.ToShortDateString()
                </div>
                <div class="itemSummaryItem">
                    @r.NrDownloads Downloads
                </div>
            </td>
        </tr>
    }
</table>

